<template>
  <div class="weekend">
     <div class="title">周末去哪儿</div>
    <ul>
      <li
        class="item border-bottom"
        v-for="item in weekendList"
        :key="item.id"
      >
        <div class="item-img-wrapper placeholder">
          <img class="item-img" v-lazy="item.imgUrl" />
        </div>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script scoped>
export default {
  name: 'Weekend',
  data () {
    return {}
  },
  props: {
    weekendList: {
      type: Array,
      default () {
        return []
      }
    }
  },
  components: {}
}
</script>

<style lang='less' scoped>
  .weekend{
    .title{
        line-height: 0.8rem;
        background-color: #eee;
        text-indent: .2rem;
      }
    ul>{
      padding:.2rem;
      .item-img-wrapper{
        position: relative;
        width: 100%;
        overflow: hidden;
        border-radius: 3%;
        .item-img{
          position: absolute;
          top: 0;
          width: 100%;
          border-radius: 3%;
        }
      }
      .placeholder:after{
        content: '';
        display: block;
        margin-top: 37.09%; //margin 百分比相对父元素宽度计算
      }
      .item-info{
        padding: .1rem;
        .item-title{
          line-height: 0.54rem;
          font-size:.32rem;
          .ellipsis()
        }
        .item-desc{
          line-height: 0.4rem;
          color:#ccc;
          .ellipsis();
        }
      }
    }
// 图片占位符https://segmentfault.com/a/1190000004231995
  }
</style>
